package com.cqemme.hardwareservice.feign;

import com.cqemme.comm.po.Result;
import com.cqemme.hardwareservice.feign.fallback.SchoolServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 学校服务
 *
 * @author daibin
 */
@FeignClient(value="school-service", name = "school-service", fallbackFactory= SchoolServiceFallbackFactory.class)
public interface SchoolServiceFeign {

    /**
     * 传入设备号 查询学生信息
     *
     * @param imeiNo 设备id
     * @return
     */
    @GetMapping(value = "/student/findByImeiNo")
    Result findByImeiNo(@RequestParam("imeiNo") Long imeiNo);

    /**
     * 传入学生id 查学生所拥有的所有人物关系
     * @param userId
     * @return
     */
    @GetMapping(value = "/unite/findByUserId")
    Result selectByStudentId(@RequestParam("userId") int userId);

    /**
     * 根据租户id 和设备id找设备
     * @param tenantId
     * @param deviceId
     * @return
     */
    @GetMapping(value = "/device/queryByTenantIdAndDeviceId")
    Result queryByTenantIdAndDeviceId(@RequestParam("tenantId") Integer tenantId,@RequestParam("deviceId") Integer deviceId);

    /**
     * 根据组织编码 获取异常时段配置
     * @param siOrgCode
     * @param weekNum
     * @return
     */
    @GetMapping(value = "/unusual/queryByOrgAndWeekNum")
    Result queryByOrgAndWeekNum(@RequestParam("siOrgCode") Integer siOrgCode,@RequestParam("weekNum") Integer weekNum);

    /**
     * 根据组织编码 获取异常时段配置
     * @param type
     * @return
     */
    @GetMapping(value = "/device/queryAllByDevice")
    Result queryAllByDevice(@RequestParam("type") Integer type);
}
